import 'package:flutter/material.dart';
import 'package:flutter_rider/main/widgets/ext/u_text.dart';
import 'package:flutter_rider/main/widgets/ext/u_title_layout.dart';
import 'package:flutter_rider/utils/screen_fit.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../generated/r.dart';
import '../widgets/ui_constant.dart';

class PrintSettingPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _PrintSettingPageState();
  }
}

class _PrintSettingPageState extends State<PrintSettingPage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: UIColor.color_main,
        appBar: UTitleLayout.getBackTitle(context, "打印机设置"),
        body: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            56.hspace,
            SvgPicture.asset(R.image_print_empty, width: 200.rpx, height: 200.rpx),
            32.hspace,
            Padding(
              padding: EdgeInsets.symmetric(horizontal: 12.rpx),
              child: UText.getBkButton("搜索打印机", 16.rpx,
                  width: double.infinity,
                  height: 48.rpx,
                  radius: 12.rpx,
                  bkColor: UIColor.color_primary,
                  onPressed: _onClickSearch),
            ),
          ],
        ));
  }

  _onClickSearch() async {
    // var dialog = LoadingDialog(context);
    // var results = await bluetoothPrint.startScan(timeout: const Duration(seconds: 4));
    // dialog.hide();
    //
    // Pickers.showSinglePicker(context, data: results, onConfirm: (res, pos) {
    //   setState(() {});
    // });
  }
}